import Vue from 'vue'
import Loading from '../components/com-loading.vue'

const LoadingConstructor = Vue.extend(Loading)

const instance = new LoadingConstructor({})
instance.vm = instance.$mount()
document.body.appendChild(instance.vm.$el)
console.log('instance', instance.vm)

const loading = {
    show: () => {
        instance.vm.visible = true
    },
    hide: () => {
        instance.vm.visible = false
    }
}

export default loading
